//
//  BZCureDataModel.m
//  QuickCure
//
//  Created by brice Mac on 16/9/13.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "BZCureDataModel.h"
#import "NetWorkTool.h"
#import "NetWorkDefine.h"


@implementation BZCureDataModel

+ (instancetype)modelWithDict:(NSDictionary *)dict{
    
    BZCureDataModel *one = [[BZCureDataModel alloc]init];
    
    [one setValuesForKeysWithDictionary:dict];
    
    return one;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}



+ (void)infoListWithCI1_id:(NSNumber *)ci1_id Success:(void (^)(BZCureDataModel *))successBlock error:(void (^)())errorBlock {
    
    NSString *urlString = kSearchCI3Url;
    NSDictionary *paramDic = @{
                               @"page_size":@15,
                               @"page":@1,
                               @"ci1_id":ci1_id,
                               @"keyword":@""
                               };
    
    [[NetWorkTool shareManager] POST_RequestWithUrlString:urlString parmas:paramDic successBloock:^(NSDictionary *responseObject) {
        
        BZCureDataModel *model = [BZCureDataModel modelWithDict:responseObject];
        
        if (successBlock) {
            successBlock(model);
        }
        
    } failureBlock:^(NSError *error) {
        
        if (errorBlock) {
            errorBlock();
        }
    }];
    
}



+ (void)infoListWithUrlString:(NSString *)urlString param:(NSDictionary *)paramDic success:(void (^)(BZCureDataModel *))successBlock error:(void (^)())errorBlock {
    
    
    [[NetWorkTool shareManager] POST_RequestWithUrlString:urlString parmas:paramDic successBloock:^(NSDictionary *responseObject) {
        
        BZCureDataModel *model = [BZCureDataModel modelWithDict:responseObject];
        
        if (successBlock) {
            successBlock(model);
        }
        
    } failureBlock:^(NSError *error) {
        
        if (errorBlock) {
            errorBlock();
        }
    }];
    
}


@end
